﻿<html>

	<head>
		<meta charset="UTF-8">
		<title>ckplayer播放</title>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<script type="text/javascript" src="ckplayer.js"></script>
	</head>

	<body>
		<div id="video" class="video"></div>
		<script type="text/javascript">
			//获取地址栏里传递过来的视频地址
			function getUrlParam(name) {
				var reg = new RegExp("(^|&)" + name + "=([^;]*)(;|$)"); //构造一个含有目标参数的正则表达式对象
				var r = window.location.search.substr(1).match(reg); 
				if(r != null) return decodeURI(r[2]);
				return null; //返回参数值
			}
			var videoUrl2 =getUrlParam('videourl');
			var a=videoUrl2.split(",");
			var nextpage=a[0];
			var videoUrl=a[1];
			var videoObject = {
				container: '#video',
				variable:'player',
				autoplay: true, 
				loop: false, 
				live: false, 
				flashplayer: false, 
				loaded: 'loadedHandler', 
				video:videoUrl

			};


			var player=new ckplayer(videoObject);
			function loadedHandler(){
				player.addListener('ended', endedHandler); 
				}
			function endedHandler(){
					 if(nextpage!='' && nextpage !='undefined'){
						top.location.href = nextpage;
					}
				}
	
		</script>
		
	</body>

</html>
 